package com.heatup.apt.api.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.heatup.apt.api.service.RechargeDiscountService;
import com.heatup.apt.common.dao.RechargeDiscountMapper;
import com.heatup.apt.model.RechargeDiscount;

/**
 * 查询城市接口实现类
 * @author jixiangyun
 * 2016年12月15日 上午11:13:10
 */
@Service
public class RechargeDiscountServiceImpl implements RechargeDiscountService {
	
	private static final Logger logger = LoggerFactory.getLogger(RechargeDiscountServiceImpl.class); 
	
	@Autowired
	RechargeDiscountMapper rechargeDiscountMapper;
	
	/**
	 * 查询所有的充值折扣记录
	 */
	@Override
	public List<RechargeDiscount> queryRechargeDiscountAll() {
		List<RechargeDiscount> list = rechargeDiscountMapper.selectBatchIds(null);
		return list;
	}
	
	/**
	 * 根据城市来查询城市记录
	 */
	@Override
	public List<RechargeDiscount> queryRechargeDiscountByCity(int cityId) {
		Map<String,Object> paramsMap = new HashMap<String,Object>();
		paramsMap.put("city_id", cityId);
		List<RechargeDiscount> list = rechargeDiscountMapper.selectByMap(paramsMap);
		return list;
	}

}
